﻿<?php $this->load->view('common/admin_header');?>
<div class="block">
  <div class="block_head">
    <div class="bheadl"></div>
    <div class="bheadr"></div>
    <h2><?=$lang['content_lable_2']?></h2>
  </div>
  <!-- .block_head ends -->
  <div class="block_content">
    <p class="breadcrumb"><?=$lang['global_lable_14']?> &raquo; <a href="<?=site_url('admins/index')?>"><?=$lang['global_lable_11']?></a> &raquo; <?=$lang['content_lable_1']?> &raquo; <strong><?=$lang['content_lable_2']?></strong></p>
    <?php $this->load->view('common/notify');?>
    <form action="<?=site_url('admins/pages')?>" method="get">
      <input type="hidden" name="field" value="<?=isset($field)?$field:'n.sort_order'?>" id="field">
      <input type="hidden" name="sort" value="<?=isset($sort)?$sort:'asc'?>" id="sort">
      <table cellpadding="0" cellspacing="0" width="100%" class="sortable">
        <thead>
          <tr>
            <th><a id="nd.title" class="<?=isset($field) && $field=='nd.title'?$sort:'';?>" href="#"><?=$lang['global_lable_15']?></a></th>
            <!-- <th><a id="n.unique_url" class="<?=isset($field) && $field=='n.unique_url'?$sort:'';?>" href="#">靜態網址</a></th> -->
            <!-- <th><a id="n.view_num" class="<?=isset($field) && $field=='n.view_num'?$sort:'';?>" href="#">檢視</a></th> -->
            <th><a id="n.status" class="<?=isset($field) && $field=='n.status'?$sort:'';?>" href="#"><?=$lang['global_lable_16']?></a></th>
            <th><a id="n.sort_order" href="#" class="<?=isset($field) && $field=='n.sort_order'?$sort:'';?>"><?=$lang['global_lable_17']?></a></th>
            <th><a id="n.add_time" class="<?=isset($field) && $field=='n.add_time'?$sort:'';?>" href="#"><?=$lang['global_lable_18']?></a></th>
            <th><a id="n.update_time" class="<?=isset($field) && $field=='n.update_time'?$sort:'';?>" href="#"><?=$lang['global_lable_19']?></a></th>
            <!-- <th><a id="n.parent" class="<?=isset($field) && $field=='n.parent'?$sort:'';?>" href="#">所屬Menu</a></th> -->
            <th style="text-align:center"><?=$lang['global_lable_21']?></th>
          </tr>
          <tr>
            <td><input type="text" class="stext" name="title" lang="zh-TW" x-webkit-speech x-webkit-grammar="bUIltin:search" value="<?=isset($title)?$title:''?>" id="title"></td>
            <!-- <td><input type="text" class="stext" name="unique_url" lang="zh-TW" x-webkit-speech x-webkit-grammar="bUIltin:search" value="<?=isset($unique_url)?$unique_url:''?>" id="unique_url"></td> -->
            <td>&nbsp;</td>
            <td>&nbsp;</td>
            <!-- <td>&nbsp;</td> -->
            <td>&nbsp;</td>
            <td>&nbsp;</td>
            <!--<td>
              <select name="parent" id="parent">
                 <option value="">請選擇</option>
                 <option value="0" <?=isset($parent) && is_numeric($parent) && 0==$parent?'selected':''?>>預設類別</option>
                 <?php if(isset($menus) && is_array($menus) && count($menus)>0):?>
                  <?php foreach($menus as $key=>$menu):?>
                  <option <?=isset($parent) && $key==$parent?'selected':''?> value="<?=$key?>"><?=$menu?></option>
                  <?php endforeach;?>
                 <?php endif;?>
              </select>
            </td>-->
            <td style="text-align:center">
              <input type="submit" class="btn btn-small btn-primary" name="sub_filter" value="<?=$lang['global_lable_22']?>"/>
              <a href="<?=site_url('admins/pages/add')?>" class="btn btn-small btn-danger"><i class="icon-plus"></i> <?=$lang['global_lable_23']?></a>
            </td>
          </tr>
        </thead>
        <tbody class="table">
          <?php if(isset($lists_count) && $lists_count>0):?>
          <?php foreach($lists->result_array() as $list):
            $urls=site_url('admins/pages/%s/'.$list['id']);
            $status=$list['status']==1?$lang['global_lable_37']:$lang['global_lable_38'];
            //$parent=$list['parent']!=0?$menus[$list['parent']]:'預設類別';
          ?>
          <tr>
            <td title="<?=$list['title']?>"><?=mb_substr($list['title'],0,20,'utf-8')?>
              <?php if(mb_strlen($list['title'])>20) echo '...';?></td>
            <!-- <td><?=$list['unique_url']?></td> -->
            <!-- <td><a href="javascript:void(0);" onClick="reset_item('<?=sprintf($urls,"reset")?>')"><?=$list['view_num']?></a></td> -->
            <td><?=$status?></td>
            <td><?=$list['sort_order']?></td>
            <td><?=date($format_time,$list['add_time'])?></td>
            <td><?=date($format_time,$list['update_time'])?></td>
            <!-- <td><?=$parent?></td> -->
            <?php $borwer_url=!in_array($list['unique_url'],array('about','contact','job'))?'cms/'.$list['unique_url']:$list['unique_url'];?>
            <td class="listaction">
              <a href="<?=base_url().'#'.$list['unique_url']?>" class="l_browse" target="_blank"><?=$lang['global_lable_43']?></a>
              <a href="<?=sprintf($urls,"edit");?>" class="l_edit"><?=$lang['global_lable_24']?></a>
              <a href="javascript:void(0);" onClick="delete_item('<?=sprintf($urls,"delete")?>');" class="l_delete"><?=$lang['global_lable_25']?></a>
            </td>
          </tr>
          <?php endforeach;?>
          <?php else:?>
          <tr>
            <td colspan="9" class="nodata"><p><?=$lang['global_lable_42']?></p></td>
          </tr>
          <?php endif;?>
        </tbody>
      </table>
      <!-- .tableactions ends -->
      <div id="pagination"><?php echo $pagination;?><div class="listscount"><?=$lang['global_lable_29']?> <?=$lists_count?> <?=$lang['global_lable_30']?></div></div>
      <!-- .pagination ends -->
    </form>
  </div>
  <!-- .block_content ends -->
  <div class="bendl"></div>
  <div class="bendr"></div>
</div>
<!-- .block ends -->
<?php $this->load->view('common/admin_footer');?>